The present invention relates to linearity error correction, and more particularly to a method of linearity compensation by canceling harmonics generated in signal processing systems, such as analog-to-digital converters (ADCs).
Distortion is generated by all types of non-linear systems, i.e., systems S( ) whereS(f(t)+g(t))≠S(f(t))+S(g(t)) where f(t) and g(t) are two signals. If an input to a non-linear system is repetitive over a certain period T, then its passage through a memory-less non-linear system is also repetitive over the same period. Fourier theory requires that:
a) all repetitive signals of period T may be expressed as a sum of a DC offset, a fundamental sine wave of period T, and the harmonics of the fundamental;
b) the fundamental and harmonics each have an amplitude and phase that is uniquely defined by the shape of the repetitive signal.
A sine frequency is the reciprocal of its period or cycle time, so the fundamental frequency is 1/T cycles per second or Hertz. A harmonic of a sine wave of period T is a frequency that is an integer multiple of the fundamental frequency so the nth harmonic has frequency n/T or a period of T/n.
In mathematical terms a real signal Y(t) that repeats with frequency f may be expressed as:Y(t)=DC+Σn=1−M(A(n, f)sin(2π n ft+P(n, f))) A(n, f) is the amplitude of the nth harmonic for the fundamental frequency and P(n, f) is the corresponding phase. Also 2πf=ω in radians/second, the unit of angular frequency, so there are 2π radians in a circle or cycle. In realizable systems the passage of high frequencies, and therefore high harmonics, is limited. For example analog systems are limited by maximum drive current capabilities and capacitive loading so in practice M does not extend to infinity. A repetitive signal may then be defined in terms of T and two finite sets of M amplitudes {A} and phase {P}.
If the fundamental frequency is applied to the non-linear system input, then the output consists of the fundamental itself and its various harmonics. As the input has no harmonics, the amplitude of each harmonic of the system output relative to the amplitude of the fundamental is a measure of its harmonic distortion. Spurious Free Dynamic Range (SFDR) is a measure of the relative size of the largest harmonic with respect to the fundamental for a defined range of pure sine-wave input frequencies. ADCs usually have a much better measured SFDR for specially complicated inputs when dither signals are added.
In some non-linear electronic devices it is possible for a time-varying input to modulate itself elsewhere in the circuit, producing harmonics directly on the output. The “fingerprint” of self-modulation of a signal is an output with very few discernible harmonics, usually very rapidly diminishing with harmonic number. This is because each harmonic n arises from the multiplication of n small signals—even the 3rd harmonic can become insignificant. For example activity on an analog buffer/driver may affect the power supply, which in turn modulates subsequent analog signal voltages. In multi-stage pipelined analog-to-digital converters (ADCs), powerful buffers may be needed to drive multi-input flash ADCs at each stage. Also small difference signals are amplified between each stage, so the number of harmonics may relate to the number of stages.
In some cases more than one path may create a given harmonic. If the different paths are subject to different delays, than a comb response may result. This may appear as rapid changes in amplitude of the harmonic as a function of input frequency, although much less variation than with quantization distortion. Combing may make some harmonics very difficult to neutralize.
For cancellation of a self-modulated harmonic, consider an added error term consisting of a multiplication of a signal with itself:Y(t)=X(t)+KX(t)2 K is assumed to be small. To correct for the error term:X′(t)≈Y(t)−K′Y(t)2 For K′=K, substituting Y(t) into the above equation, expanding and simplifying produces:X′(t)≈X(t)−2K2X(t)3−K3X(t)4 For small K the last two terms are even smaller, and the approximation is accurate. Similar arguments exist for other powers.
For exact correction of a large single harmonic due to this mechanism, the strict inverse function is obtained from the inversion of the series. To generalize for the nth power:Y(t)=X(t)+KX(t)n=X(t)(1+KX(t)n−1) The correction for that power may be applied in the form:X(t)=Y(t)(1−Correction(n,KY(t)n−1)) where for the nth harmonic and an input p:Correction(n,p)=−nΣk=1→R{((nk−1)!(−p)k)/(((n−1)k+1)!(k−1)!)}Convergence of this sum is guaranteed for finite integer R if:|p|<(n−1)n−1/nn and then p=KY(t)n−1 The restriction for |p| allows K to be in the range:ti |K|<{(n−1)/n|Ymax|}n−1(1/n)The Correction function for a chosen harmonic may be encoded into a correction look-up table with input p, so only an additional multiply is required. The subtraction may be combined into the look-up table or performed outside the table to minimize the size of the table.
This solution is not applicable when two or more harmonics exist unless the polynomial is factored into a more generalized form:Y(t)=X(t)Πi=0→r(1+KiX(t)n(i)−1) Each term in this product may be corrected, or factored out, by applying the above algorithms sequentially until X(t) remains. Unfortunately factorization into the simple real terms above is not always possible. The above assumes a distortion mechanism that can be corrected at each instant in time, In general this turns out not to be the case, and a different non-linear correction scheme needs to be used.
In practice analog circuits have many different distortion mechanisms, often involving modulation of the input by various small signals with delays and amplitudes that vary with frequency. Even for the single sine-wave input case, the amplitude and phase of a particular harmonic distortion with respect to the fundamental is usually a function of the input frequency, its amplitude and DC offset. An approach taken in U.S. Pat. Nos. 6,344,810, 6,424,275 and 6,570,514 assumes that each power of the input has an associated delay. The amplitude and phase of each harmonic is assumed to be a function of input frequency:Y(t)=X(t)+Σn=2→MK(n,X(t))X(t+D(n,X(t)))n D(n,X(t)) is the time delay of the nth harmonic as a function of the input X(t), and K(n,X(t)) is now, unlike K previously above, related to the amplitude of the nth harmonic also as a function of X(t).
When measuring the phase and amplitude of the harmonics of an output of a non-linear system conforming to the above, for small K( ) the following approximation may be used to correct each harmonic:X(t)=Y(t)−Σn=2→MK′(n,X(t))X(t−D′(n,X(t)))n This approximate inverse works as long as the measured function K′ is close to the actual K, and D′ is close to D. Considering the even harmonics, the 6th harmonic distortion also introduces harmonics at the 4th and 2nd and a DC offset. In fact these harmonics are larger than the 6th harmonic for which correction is sought. The power function above implies a harmonic profile:cos(ωt)6=({fraction (1/64)})(2cos(6 ωt)+12cos(4 ωt)+30cos(2 ωt)+20) Note that the amplitude of the 4th harmonic is six times larger than the 6th, and the 2nd is 15 times larger.
The even harmonics may be canceled by finding the largest even harmonic and calibrating the correct amplitude/phase to cancel it. Then find the residual harmonic in the input signal that is two lower and add in the term that also is two lower, i.e., the 4th harmonic introduced when correcting the 6th harmonic, while accounting for differences in their amplitude and phase. A cos(ωt)4 term is then generated with its own amplitude/gain response to cancel this combined 4th residual harmonic. Both the 4th and 6th harmonic corrections introduce 2nd harmonics. A final squaring term cancels the result of combining these with any 2nd harmonic distortion in the input. For any degree of harmonics this process may be applied to calibration correction until all even harmonics are canceled, and is performed over the required input frequency range. A similar method is applied to cancel each of the odd harmonics.
The frequencies used for calibration are chosen to be close enough to assume adequately smooth behavior for changes in harmonic delay and amplitude over all possible frequencies in the desired range. In general evenly spaced frequencies make the design of the delay and amplitude compensation easier. In practice once the phase, converted to delay as D=phase/ω, and amplitude corrections for each harmonic are obtained, then a set of discrete Fourier Transforms (DFTs) may be used to design a set of filter coefficients for each harmonic. For properly chosen, regularly spaced calibration frequencies the set of DFTs may be efficiently implemented as a fast Fourier Transform (FFT). The filter effectively provides a function that delays the input X(t) and adjusts its amplitude. Each filter is placed before its power function generator. The filter response for the nth harmonic is:Q(n,ωt)=P(n,X(t))X(1+D(n,X(t))) raised to the power of n:Q(n,ωt)n=P(n,X(t))nX(1+D(n,X(t)))n The right side of this result becomes:P(n,X(t))=K(n,X(t))1/n This represents the amplitude response required of the filtering obtained from the calibrated response K( ) if it is placed before the power function for each harmonic.
It is possible to apply the filtering directly after the power function, but in a sampled system the filter cannot then distinguish between an input frequency and the aliases of the harmonics generated by the power function that may fold back in-band. To obtain unambiguous cancellation, aliasing may severely restrict the usable input bandwidth in this case. Filtering before each power function is very much preferred, as aliased harmonics may then be canceled correctly over a large input bandwidth. In fact the aliasing mechanism may then be ignored in the filter design process, as aliased frequencies map the same way in all sampled distortion mechanisms. However the calibration algorithm does need to calculate where aliased harmonics lie so that amplitude and phase responses may be measured at the correct position in the sampled spectrum.
As part of the calibration process measured delays are translated into equivalent filter phase shifts. A phase shift is a property of the filter coefficient design, not the sample clock frequency. If the clock frequency changes after calibration, the phase shift at a frequency corresponds to a different actual delay, and compensation does not work correctly. It is important to use fixed sample rates in linearity error compensation systems. The complexity of interaction between harmonics in this calibration process makes precise harmonic cancellation difficult when higher order harmonics are involved, as the filters need to be more precise to ensure that accurate cancellation occurs. Precise calibration may be more difficult if noise, quantization distortion or self-aliasing comb-filtering effects In ADCs are present.
In real systems mechanisms for generating harmonics may be very complex—no single mechanism may be responsible. Therefore a harmonic correction mechanism may only work correctly for single sine-wave inputs. More complicated inputs introduce intermodulatlon distortion:(sin(ω1t)+sin(ω2t)2=1−(½)cos(2 ω1t)−(½)cos(2 ω2t)+cos((ω1−ω2)t)−cos((ω1+ω2)t) The first two non-DC terms on the right are expected when squaring each term separately, but the last two terms result in sum and difference frequencies. If the model of powers-with-delays is correct, then a correctly calibrated cancellation system also reduces intermodulation distortion as the cancellation method also introduces intermodulation distortion of the correct phase and amplitude since it uses the same polynomial mechanism.
In practice it is unlikely that a polynomial distortion model is the only mechanism. Other mechanisms may generate a particular harmonic, so calibration for cancellation of harmonics with single sine-wave inputs may not handle intermodulation distortion correctly in the general case. The only way to correctly cancel intermodulation distortion in all cases is if the structure of the distorting circuit is understood in great detail. Once the nature of the distortions is known, then equivalent delays/filters/multiplications may be structured to produce “anti-harmonics” in an equivalent manner to the distorting circuit. Subtraction to cancel the harmonics then works over a much wider range of input conditions.
Unfortunately the designers of an ADC may not understand all the distortion mechanisms—although they attempt to eliminate the major sources of distortion. As the remaining distortions are often at a very low level, measuring them accurately is difficult. The problem with the prior proposed solutions is that each harmonic cancellation system generates lower order harmonics which may be larger than the corrected value and have to be removed in lower order harmonic correction.
What is desired is a new approach to general harmonic distortion correction to provide linearity correction, especially for multi-stage ADCs.